#include "stdafx.h"
#include "FpsCounter.h"


CFpsCounter::CFpsCounter()
: m_min(FLT_MAX)
, m_max(FLT_MIN)
, m_instant(0)
{
	
}

void CFpsCounter::Update()
{
	float frame_time = gEnv->pTimer->GetFrameTime();

	m_instant = 1.0f/frame_time;
	m_min = min(m_min, m_instant);
	m_max = max(m_max, m_instant);
}

float	CFpsCounter::Min() const
{
	return m_min;
}

float	CFpsCounter::Max() const
{
	return m_max;
}

float	CFpsCounter::Instant() const
{
	return m_instant;
}